package cn.iocoder.yudao.module.infra.service.ocr;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.infra.controller.admin.ocr.vo.config.OcrConfigPageReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.ocr.vo.config.OcrConfigSaveReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.ocr.vo.config.OcrConfigSimpleRespVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.ocr.OcrConfigDO;

import javax.validation.Valid;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * OCR Configuration Service Interface
 *
 * @author YuDao
 */
public interface OcrConfigService {

    /**
     * Create OCR configuration
     *
     * @param createReqVO Create request
     * @return Configuration ID
     */
    Long createOcrConfig(@Valid OcrConfigSaveReqVO createReqVO);

    /**
     * Update OCR configuration
     *
     * @param updateReqVO Update request
     */
    void updateOcrConfig(@Valid OcrConfigSaveReqVO updateReqVO);

    /**
     * Delete OCR configuration
     *
     * @param id Configuration ID
     */
    void deleteOcrConfig(Long id);

    /**
     * Batch delete OCR configurations
     *
     * @param ids Configuration ID list
     */
    void deleteOcrConfigList(List<Long> ids);

    /**
     * Get OCR configuration by ID
     *
     * @param id Configuration ID
     * @return OCR configuration
     */
    OcrConfigDO getOcrConfig(Long id);

    /**
     * Get OCR configuration page
     *
     * @param pageReqVO Page request
     * @return OCR configuration page
     */
    PageResult<OcrConfigDO> getOcrConfigPage(OcrConfigPageReqVO pageReqVO);

    /**
     * Get OCR configuration by type and status
     *
     * @param type   OCR type
     * @param status Status
     * @return OCR configuration
     */
    OcrConfigDO getOcrConfigByTypeAndStatus(String type, Integer status);

    /**
     * Get available OCR configuration by status (first available)
     *
     * @param status Status
     * @return OCR configuration
     */
    OcrConfigDO getAvailableOcrConfig(Integer status);

    /**
     * Test OCR configuration
     *
     * @param id Configuration ID
     * @return Test result
     */
    String testOcrConfig(Long id);

    /**
     * Get OCR configuration simple list
     *
     * @return OCR configuration simple list
     */
    List<OcrConfigSimpleRespVO> getOcrConfigSimpleList();

    /**
     * Get OCR configuration name map by IDs
     *
     * @param configIds Configuration ID set
     * @return Configuration name map
     */
    Map<Long, String> getOcrConfigNameMap(Set<Long> configIds);

}